<div class="layuimini-container layui-anim layui-anim-upbit">
    <div class="layuimini-main">
		<form class="layui-form" id="vForm">
			<#if fees??&&fees.id??>
				<input type="hidden" id="id" name="id" value="${(fees.id)!}">
			</#if>
		  <div class="layui-form-item">
		    <label class="layui-form-label"> 规费类型</label>
		    <div class="layui-input-block">
		    	<select name="dict.id">
		    		<#if dictList??>
		    			<#list dictList as list>
		    				<#if fees??&&list.id==fees.dict.id>
		    					<option value="${(list.id)!}" selected="selected">${(list.name)!}</option>
		    				<#else>
		    					<option value="${(list.id)!}">${(list.name)!}</option>
		    				</#if>
		    			</#list>
		    		</#if>
		    	</select>
		    </div>
		  </div>
		  <div class="layui-form-item">
		    <label class="layui-form-label"> 缴费时间</label>
		    <div class="layui-input-block">
		      <input type="text" id="date" name="date" value="${(fees.date)!}" lay-verify="required" placeholder="请输入缴费时间" autocomplete="off" class="layui-input">
		    </div>
		  </div>
		  <div class="layui-form-item">
		    <label class="layui-form-label"> 缴费金额</label>
		    <div class="layui-input-block">
		      <input type="text" id="money" name="money" value="${(fees.money)!}" lay-verify="required" placeholder="请输入缴费金额" autocomplete="off" class="layui-input">
		    </div>
		  </div>
		  <div class="layui-form-item">
		    <label class="layui-form-label"> 缴费地址</label>
		    <div class="layui-input-block">
		      <input type="text" id="address" name="address" value="${(fees.address)!}"lay-verify="required" placeholder="请输入缴费地址" autocomplete="off" class="layui-input">
		    </div>
		  </div>
		  <div class="layui-form-item">
		    <label class="layui-form-label">收据</label>
		    <div class="layui-input-block">
		      <button type="button" class="layui-btn" id="video_btn">选择文件</button>
		      <input type="text" id="img" name="img" class="layui-input" value="${(fees.img)!}" lay-verify="required" readonly="readonly">
		    </div>
		  </div>
		  <div class="layui-form-item">
		    <label class="layui-form-label"> 备注</label>
		    <div class="layui-input-block">
		      <input type="text" id="remarks" name="remarks" value="${(fees.remarks)!}" placeholder="请输入备注" autocomplete="off" class="layui-input">
		    </div>
		  </div>
		  <div class="layui-form-item">
		    <div class="layui-input-block">
		      <button type="submit" class="layui-btn" lay-submit="" lay-filter="formDemo">提交</button>
		      <button type="reset" class="layui-btn layui-btn-primary">重置</button>
		      <button type="button"  class="layui-btn layui-btn-primary" onclick="goBack();">取消</button>
		    </div>
		  </div>
		</form>
	</div>
</div>
<script>
var layuimini;
layui.use(['layuimini','form','upload','laydate'], function(){
  var form = layui.form;
  var upload = layui.upload;
  form.render();
  var laydate = layui.laydate;
  layuimini = layui.layuimini;
  //常规用法
  laydate.render({
    elem: '#date'
  });
  //
  //监听提交
  form.on('submit(formDemo)', function(data){
//     	layer.msg(JSON.stringify(data.field));
    	$.post("/private/fees/save",data.field,function(obj){
    		layer.alert(obj.message,function(index){
    			if(obj.success){
    				layuimini.hash("page/user_fees_list.html");
    				layer.close(index);
    			}
    		});
    	},"json");
    	return false;
  	});
  var index=null;
  var uploadInst = upload.render({
		elem: '#video_btn', //绑定元素
		url: 'upload', //上传接口
		field: "file",
		accept: 'file',//普通文件
		before: function(obj){
			index = layer.load(1, {
				shade : [ 0.5, '#DBDBDB' ]
			});
		},
		done: function(data) {
			//上传完毕回调
			$("#img").val(data.data);
			layer.close(index);
		},
		error: function() {
			//请求异常回调
			layer.alert("上传失败");
			layer.close(index);
		}
	});	
});
var goBack = function(){
	layuimini.hash("page/user_fees_list.html");
}
</script>
